package java3_16.Circle;

/**
 * 1:圆类有半径属性和圆周率属性，有求面积和周长的方法（把圆周率定义成static），用oop模拟。
 */
public class Circle {
    private double radius;
    static private double pi = 3.14 ;

    public Circle(double radius){
       this.radius = radius;
    }

    public double area(){
        return pi*radius*radius;
    }

    public double perimeter(){
        return 2*pi*radius;
    }
    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }

    public double getPi() {
        return pi;
    }

    public void setPi(double pi) {
        this.pi = pi;
    }
}
